//
//  PXIMasterController.m
//  Mixer
//
//  Created by decaf on 2/14/05.
//  Copyright 2005 __MyCompanyName__. All rights reserved.
//

#import "PXIMasterController.h"

@implementation PXIMasterController

- (id) init
{
	[super init];
	if ( self )
	{
		managedWindows = [[NSMutableDictionary alloc] init];
		currentTool = 0;
	}
	return self;
}

- (void) createNewWindow:(NSString *)windowTitle
{
	//NSWindow * w = [[NSWindow alloc] initWithContentRect:NSMakeRect( 200, 200, 512, 342 ) styleMask:( NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask ) backing:NSBackingStoreBuffered defer:YES];
	//[w setTitle:windowTitle];
	//[w makeKeyAndOrderFront:nil];
	
	[managedWindows setObject:[[PXIManagedWindowController alloc] init] forKey:windowTitle];
	
	PXIManagedWindowController * newWindow = [managedWindows objectForKey:windowTitle];
	
	[newWindow show:windowTitle];
}

- (int)currentTool {
    return currentTool;
}

- (void)setCurrentTool:(int)newCurrentTool {
    if (currentTool != newCurrentTool) {
        currentTool = newCurrentTool;
		
		[NSApp updateWindows];
	}
}

@end
